package org.example.entity;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 实体类 Category 消费种类，例如：饮食、住宿、图书、电影
 */
@NoArgsConstructor
@Getter
@Setter
public class Category {
    private int id;
    private String name;
    private int recordNumber;           // 该消费种类，总共的记录次数
    private double recordTotalSpend;    // 该消费种类，总共的花费


    public Category(int id, String name) {
        this.id = id;
        this.name = name;
    }


    /**
     * 用于 CategoryComboBoxModel 显示消费种类的字符串
     *
     * @return string
     */
    @Override
    public String toString() {
        return name;
    }
}
